home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / low_0514.zip / INSTALL.EXE / _LDEFS.H next >
C/C++ Source or Header  |  1996-10-26  |  5KB  |  236 lines

  1.  
  2. // ----------------------------------------------------------------------
  3. // LoraBBS Professional Edition - Version 3.00.11
  4. // Copyright (c) 1996 by Marco Maccaferri. All rights reserved.
  5. //
  6. // History:
  7. //    05/20/95 - Initial coding.
  8. // ----------------------------------------------------------------------
  9.  
  10. #ifndef __LDEFS_H
  11. #define __LDEFS_H
  12.  
  13. #if defined(_MSC_VER)
  14. #undef _WINDOWS
  15. #endif
  16.  
  17. #if !defined(__LINUX__)
  18. #include <conio.h>
  19. #include <dos.h>
  20. #if defined(__BORLANDC__)
  21. #include <dirent.h>
  22. #endif
  23. #include <direct.h>
  24. #if defined(__OS2__) && defined(__BORLANDC__)
  25. #define __IN_IOCTL
  26. #endif
  27. #include <io.h>
  28. #include <process.h>
  29. #include <share.h>
  30. #include <sys\stat.h>
  31. #endif
  32.  
  33. #include <ctype.h>
  34. #include <fcntl.h>
  35. #include <malloc.h>
  36. #if defined(_MSC_VER) || defined(__LINUX__)
  37. #include <memory.h>
  38. #else
  39. #include <mem.h>
  40. #endif
  41. #if defined(__BORLANDC__) || defined(__LINUX__)
  42. #include <utime.h>
  43. #else
  44. #include <sys\utime.h>
  45. #endif
  46. #include <stdarg.h>
  47. #include <stdio.h>
  48. #include <stdlib.h>
  49. #include <string.h>
  50. #include <time.h>
  51.  
  52. #if defined(__LINUX__)
  53. #include <dirent.h>
  54. #include <sys/types.h>
  55. #include <sys/stat.h>
  56. #include <unistd.h>
  57.  
  58. #pragma pack(1)
  59. #define cprintf         printf
  60.  
  61. #define O_BINARY        0
  62. #define SH_DENYNO       0
  63. #define SH_DENYRW       0
  64.  
  65. struct dosdate_t {
  66.    unsigned char day;
  67.    unsigned char month;
  68.    unsigned int year;
  69.    unsigned char dayofweek;
  70. };
  71.  
  72. struct dostime_t {
  73.    unsigned char hour;
  74.    unsigned char minute;
  75.    unsigned char second;
  76.    unsigned char hsecond;
  77. };
  78.  
  79. void chsize (int fd, long size);
  80. void _dos_getdate (struct dosdate_t *ddate);
  81. void _dos_gettime (struct dostime_t *dtime);
  82. long filelength (int fd);
  83. FILE *_fsopen (char *name, char *mode, int shflags);
  84. int sopen (char *file, int flags, int shmode, int mode);
  85. int stricmp (char *s1, char *s2);
  86. int strnicmp (char *s1, char *s2, size_t maxlen);
  87. char *strlwr (char *s);
  88. char *strupr (char *s);
  89. long tell (int fd);
  90.  
  91. #endif
  92.  
  93. #if defined(__OS2__) && !defined(INCL_DOS)
  94. #define INCL_DOS
  95. #define INCL_DOSDEVICES
  96. #define INCL_DOSDEVIOCTL
  97. #define INCL_DOSSEMAPHORES
  98. #define INCL_DOSPROCESS
  99. #define INCL_PM
  100. #define INCL_VIO
  101. #define INCL_KBD
  102. #include <os2.h>
  103.  
  104. typedef struct {
  105.    ULONG SessionID;
  106.    ULONG ResultCode;
  107. } TERMNOTIFY, *PTERMNOTIFY;
  108.  
  109. #elif defined(__NT__)
  110. #include <windows.h>
  111. #endif
  112.  
  113. #if defined(__OS2__) || defined(__NT__)
  114. #if defined(_MSC_VER)
  115. #define DLL_EXPORT
  116. #else
  117. #define DLL_EXPORT      _export
  118. #endif
  119. #else
  120. #define DLL_EXPORT
  121. #endif
  122.  
  123. #ifndef TRUE
  124. #define TRUE            1
  125. #define FALSE           0
  126. #endif
  127.  
  128. #ifndef VOID
  129. typedef void            VOID;
  130. typedef void *          PVOID;
  131. typedef char            CHAR;
  132. typedef unsigned char   UCHAR;
  133. typedef unsigned char   BYTE;
  134. typedef char *          PSZ;
  135. typedef short           SHORT;
  136. typedef unsigned short  USHORT;
  137. typedef long            LONG;
  138. typedef unsigned long   ULONG;
  139. typedef int             INT;
  140. #endif
  141.  
  142. #define CTRLA           0x01
  143. #define CTRLB           0x02
  144. #define CTRLC           0x03
  145. #define CTRLD           0x04
  146. #define CTRLE           0x05
  147. #define CTRLF           0x06
  148. #define CTRLG           0x07
  149. #define CTRLH           0x08
  150. #define CTRLI           0x09
  151. #define CTRLJ           0x0a
  152. #define CTRLK           0x0b
  153. #define CTRLL           0x0c
  154. #define CTRLM           0x0d
  155. #define CTRLN           0x0e
  156. #define CTRLO           0x0f
  157. #define CTRLP           0x10
  158. #define CTRLQ           0x11
  159. #define CTRLR           0x12
  160. #define CTRLS           0x13
  161. #define CTRLT           0x14
  162. #define CTRLU           0x15
  163. #define CTRLV           0x16
  164. #define CTRLW           0x17
  165. #define CTRLX           0x18
  166. #define CTRLY           0x19
  167. #define CTRLZ           0x1a
  168. #define ESC             0x1b
  169. #define DEL             0x7f
  170.  
  171. #define BLACK           0
  172. #define BLUE            1
  173. #define GREEN           2
  174. #define CYAN            3
  175. #define RED             4
  176. #define MAGENTA         5
  177. #define BROWN           6
  178. #define LGREY           7
  179. #define DGREY           8
  180. #define LBLUE           9
  181. #define LGREEN          10
  182. #define LCYAN           11
  183. #define LRED            12
  184. #define LMAGENTA        13
  185. #define YELLOW          14
  186. #define WHITE           15
  187.  
  188. #define _BLACK          0
  189. #define _BLUE           16
  190. #define _GREEN          32
  191. #define _CYAN           48
  192. #define _RED            64
  193. #define _MAGENTA        80
  194. #define _BROWN          96
  195. #define _LGREY          112
  196.  
  197. #define BLINK           128
  198.  
  199. #define SOH             0x01
  200. #define ACK             0x06
  201. #define NAK             0x15
  202. #define SYN             0x16
  203. #define STX             0x02
  204. #define EOT             0x04
  205. #define ENQ             0x05
  206.  
  207. typedef struct {
  208.    USHORT Zone;
  209.    USHORT Net;
  210.    USHORT Node;
  211.    USHORT Point;
  212.    CHAR   Domain[32];
  213.    USHORT Flags;
  214. } ADDR;
  215.  
  216. USHORT DLL_EXPORT Crc16 (UCHAR Byte, USHORT Crc);
  217. ULONG  DLL_EXPORT Crc32 (UCHAR Byte, ULONG Crc);
  218. USHORT DLL_EXPORT StringCrc16 (CHAR *String, USHORT Crc);
  219. ULONG  DLL_EXPORT StringCrc32 (CHAR *String, ULONG Crc);
  220.  
  221. VOID   DLL_EXPORT Pause (LONG lHund);
  222. LONG   DLL_EXPORT TimerSet (LONG lHund);
  223. USHORT DLL_EXPORT TimeUp (LONG lEndtime);
  224.  
  225. PSZ    DLL_EXPORT AdjustPath (PSZ pszPath);
  226. USHORT DLL_EXPORT BuildPath (PSZ pszPath);
  227.  
  228. char * DLL_EXPORT strsrep (char *str, char *search, char *replace);
  229.  
  230. VOID   DLL_EXPORT RunExternal (PSZ Command, USHORT TimeLimit = 0);
  231. VOID   DLL_EXPORT SpawnExternal (PSZ Command);
  232. ULONG  DLL_EXPORT AvailableMemory (VOID);
  233.  
  234. #endif
  235.  
  236.